using System.Collections.Generic;
using UnityEngine;

public class Blood : MonoBehaviour
{
	private List<ParticleCollisionEvent> collisionEvents = new List<ParticleCollisionEvent>();

	private ParticleSystem ps;

	public RandomBlood randomBlood;

	private void OnEnable()
	{
		ps = GetComponent<ParticleSystem>();
	}

	private void OnParticleCollision(GameObject other)
	{
		if (!(CampaignGame.framerate < 30f))
		{
			int num = ps.GetCollisionEvents(other, collisionEvents);
			for (int i = 0; i < num; i++)
			{
				Vector3 intersection = collisionEvents[i].intersection;
				SwapPool.Add(randomBlood.gameObject, new Vector2(intersection.x, intersection.y + Random.Range(-0.5f, -0.3f)));
			}
		}
	}
}
